<?php

include_once "function_base_xml_class.php";

class CAddress
{
	private $root_path = "";
	private $node_name = "ADDRESS";
	private $dev_name  = "";
	private $key_array = array("Ip", "Enabled", "Mask", "Desc");
	public function __construct($dev, $type)
	{
		$this->root_path = "/MINI/NETWORK/INTERFACES/INTERFACE". 
				   "[@Type='". $type. "' and @Name='". $dev."']/ADDRESSES";
	}
	function GetXmlItemList()
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		return $dns->get_list();
	}
	function GetXmlTotalItem()
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		return $dns->get_list_number();
	}
	function GetXmlItemByNumber($num)
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		return $dns->get_item_by_num($num);
	}
	function AppendXmlItem($in_array)
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		$dns->append_item($in_array);
		$this->Apply();
	}
	function DelXmlItem($num)
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		$dns->del_special_item_by_num($num);
		$this->Apply();
	}
	function DelXmlAll()
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		$dns->del_all_item();
		$this->Apply();
	}
	function EditItemByNumber($num, $in_array)
	{
		$dns = new base_xml_class($this->root_path, $this->node_name, $this->key_array);
		$dns->edit_item_by_num($num, $in_array);
		$this->Apply();
	}
	function Apply()
	{
	}
}

?>
